<template>
  <el-config-provider :locale="locale">
    <router-view v-if="isRouterAlive" />
  </el-config-provider>
</template>

<script>
  import { ElConfigProvider } from 'element-plus'
  import zhCN from 'element-plus/lib/locale/lang/zh-cn'
  export default {
    name: 'App',
    provide() {
      return {
        pageReload: this.pageReload,
      }
    },
    data() {
      return {
        locale: zhCN,
        isRouterAlive: true,
      }
    },
    components: {
      ElConfigProvider,
    },
    methods: {
      pageReload() {
        this.isRouterAlive = false
        this.$nextTick(function () {
          this.isRouterAlive = true
        })
      },
    },
  }
</script>

<style lang="scss">
  @import '~@/assets/styles/app.scss';
</style>
